package com.rc.evcharger.service.order;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.rc.evcharger.mapper.order.OrderSuspendMapper;
import com.rc.evcharger.model.order.OrderSuspend;
import com.rc.evcharger.model.order.OrderSuspendExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by Sven on 2021/07/14
 */
@Service
public class OrderSuspendServiceImpl implements OrderSuspendService {
    @Autowired
    private OrderSuspendMapper orderSuspendMapper;

    @Override
    public OrderSuspendMapper getMapper() {
        return orderSuspendMapper;
    }

    @Override
    public PageInfo<OrderSuspend> listPageOrderSuspend(String tenantCode, String hlhtOperatorId, int pageIndex, int pageSize) {
        PageHelper.startPage(pageIndex, pageSize);

        //结算状态 0未结算 1已结算 默认0
        OrderSuspendExample example = new OrderSuspendExample();
        example.createCriteria().andTenantCodeEqualTo(tenantCode).andHlhtOperatorIdEqualTo(hlhtOperatorId)
                .andStatusEqualTo("0");
        return new PageInfo<>(orderSuspendMapper.selectByExample(example));
    }
}
